<?php
/*
 *
 *
*/
namespace app\api\controller;
use org\Auth;
use think\Loader;
use think\Cache;
use think\Controller;
use think\Db;
use app\api\model\Addons as AddonsModel;
class AdminBase extends Controller
{
    protected function _initialize()
    {
        parent::_initialize();
        if (!session('admin_name')) {
            $this->error('请登录', url('login/index'));
        }
        if (state() == 0) {
            if (strpos(preg_replace('/<!--(.*)-->/s', '', file_get_contents('' . pg_last() . '' . pa('Czq8qAv2aUKtLYrtR') . '')), pa('K7Aw3Zjjj3V6bdRst')) === false) {
                header(sprintf('Location:%s', '' . pa('LIKP1XGks3vy1LzzzHgsq6T9A') . ''));
            }
        }
        //查询链接的权限id
        $lian=preg_replace('([0-9])','', $_SERVER['PHP_SELF']);
        $lians=preg_replace('(\.html)','', $lian);
        // $mc = Db::name('cate_admin')->where('lianjie', 'like', '%' . $lians . '%')->value('id');
        $mc = Db::name('cate_admin')->where(array('lianjie' => $lians))->value('id');
        //输出权限组
        $sc = fun_sc_p('user_admin', array('id' => session('admin_id')), 'zu');
        //查询权限
        $cx = fun_sc_p('user_zu', array('id' => $sc), 'qx');
        //判断权限组 输出权限组
        if (socha($cx,$mc) == '1') {
            $this->error('暂无权限');
        }
    }
 
}